import java.io.*;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * user:likai
 * Date:2022-12-11
 * Time:17:35
 */
public class Demo1 {
    public static void main1(String[] args) throws IOException {
        File file=new File("./aaa.txt");
        System.out.println(file.getName());
        System.out.println(file.getParent());
        System.out.println(file.getAbsoluteFile());
        System.out.println(file.getCanonicalFile());
        file.createNewFile();
    }
    public static void main2(String[] args) throws IOException {
        OutputStream outputStream=new FileOutputStream("./aaa.txt");
        outputStream.write(97);
        outputStream.close();
    }
    public static void main3(String[] args) throws IOException {
        InputStream inputStream=new FileInputStream("./aaa.txt");
        int b=inputStream.read();
        System.out.println(b);
        inputStream.close();
    }
    public static void main4(String[] args) throws IOException {
        Reader reader=new FileReader("./aaa.txt");
        int a=reader.read();
        System.out.println(a);
        reader.close();
    }
    public static void main5(String[] args) throws IOException {
        Writer writer=new FileWriter("./aaa.txt");
        writer.write(98);
        writer.write(" hell0 world");
        writer.close();
    }

    public static void main6(String[] args) throws IOException {
        InputStream inputStream=new FileInputStream("./aaa.txt");
        Scanner scanner =new Scanner(inputStream);
        while(scanner.hasNext()){
            System.out.println(scanner.next());
        }
        inputStream.close();
    }
    public static void main(String[] args) throws IOException {
        OutputStream outputStream=new FileOutputStream("./aaa.txt");
        PrintWriter writer=new PrintWriter(outputStream);
        //writer.println();
        writer.printf("adad");
        outputStream.close();
    }
}
